using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace ctsu.Admin.Forms
{	
	public class SelectAncillaryDlg : System.Windows.Forms.Form
	{
		public int SearchChoice = 0;
		private System.Windows.Forms.RadioButton rdo4;
		private System.Windows.Forms.RadioButton rdo3;
		private System.Windows.Forms.RadioButton rdo2;
		private System.Windows.Forms.RadioButton rdo1;
		private System.Windows.Forms.Button btnOK;
		private System.Windows.Forms.RadioButton rdo0;
		private System.Windows.Forms.Button btnCancel;		
		private System.ComponentModel.Container components = null;

		public SelectAncillaryDlg(int formID)
		{
			InitializeComponent();

			switch(formID)
			{
				case 26:
					rdo0.Text = "Select by admission ancillary fields";
					rdo1.Text = "Select by admission visit fields";
					break;
				case 28:
					rdo0.Text = "Select by out patient ancillary fields";
					rdo1.Text = "Select by out patient visit fields";
					break;				
			}

		}

		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.rdo4 = new System.Windows.Forms.RadioButton();
			this.rdo3 = new System.Windows.Forms.RadioButton();
			this.rdo2 = new System.Windows.Forms.RadioButton();
			this.rdo1 = new System.Windows.Forms.RadioButton();
			this.btnOK = new System.Windows.Forms.Button();
			this.rdo0 = new System.Windows.Forms.RadioButton();
			this.btnCancel = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// rdo4
			// 
			this.rdo4.Location = new System.Drawing.Point(8, 144);
			this.rdo4.Name = "rdo4";
			this.rdo4.Size = new System.Drawing.Size(136, 24);
			this.rdo4.TabIndex = 12;
			this.rdo4.Text = "Select by investigator";
			this.rdo4.CheckedChanged += new System.EventHandler(this.rdo_CheckedChanged);
			// 
			// rdo3
			// 
			this.rdo3.Location = new System.Drawing.Point(8, 112);
			this.rdo3.Name = "rdo3";
			this.rdo3.Size = new System.Drawing.Size(136, 24);
			this.rdo3.TabIndex = 11;
			this.rdo3.Text = "Select by protocol";
			this.rdo3.CheckedChanged += new System.EventHandler(this.rdo_CheckedChanged);
			// 
			// rdo2
			// 
			this.rdo2.Location = new System.Drawing.Point(8, 80);
			this.rdo2.Name = "rdo2";
			this.rdo2.Size = new System.Drawing.Size(200, 24);
			this.rdo2.TabIndex = 10;
			this.rdo2.Text = "Select by patient";
			this.rdo2.CheckedChanged += new System.EventHandler(this.rdo_CheckedChanged);
			// 
			// rdo1
			// 
			this.rdo1.Location = new System.Drawing.Point(8, 48);
			this.rdo1.Name = "rdo1";
			this.rdo1.Size = new System.Drawing.Size(200, 24);
			this.rdo1.TabIndex = 9;
			this.rdo1.Text = "Select by visit fields";
			this.rdo1.CheckedChanged += new System.EventHandler(this.rdo_CheckedChanged);
			// 
			// btnOK
			// 
			this.btnOK.Location = new System.Drawing.Point(32, 176);
			this.btnOK.Name = "btnOK";
			this.btnOK.TabIndex = 8;
			this.btnOK.Text = "&OK";
			this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
			// 
			// rdo0
			// 
			this.rdo0.Checked = true;
			this.rdo0.Location = new System.Drawing.Point(8, 16);
			this.rdo0.Name = "rdo0";
			this.rdo0.Size = new System.Drawing.Size(200, 24);
			this.rdo0.TabIndex = 13;
			this.rdo0.Text = "Select by ancillary";
			this.rdo0.CheckedChanged += new System.EventHandler(this.rdo_CheckedChanged);
			// 
			// btnCancel
			// 
			this.btnCancel.Location = new System.Drawing.Point(120, 176);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.TabIndex = 14;
			this.btnCancel.Text = "&Cancel";
			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
			// 
			// SelectAncillaryDlg
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(226, 208);
			this.ControlBox = false;
			this.Controls.Add(this.btnCancel);
			this.Controls.Add(this.rdo0);
			this.Controls.Add(this.rdo4);
			this.Controls.Add(this.rdo3);
			this.Controls.Add(this.rdo2);
			this.Controls.Add(this.rdo1);
			this.Controls.Add(this.btnOK);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "SelectAncillaryDlg";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "SelectAncillaryDlg";
			this.ResumeLayout(false);

		}
		#endregion

		private void btnOK_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void rdo_CheckedChanged(object sender, System.EventArgs e)
		{
			if(rdo0.Checked)
				this.SearchChoice = 0;
			else if(rdo1.Checked)
				this.SearchChoice = 1;			
			else if(rdo2.Checked)
				this.SearchChoice = 2;			
			else if(rdo3.Checked)
				this.SearchChoice = 3;			
			else if(rdo4.Checked)
				this.SearchChoice = 4;			
		}

		private void btnCancel_Click(object sender, System.EventArgs e)
		{
			this.SearchChoice = -1;
			this.Close();
		}
	}
}
